package com.weijian.controller.admin;

import com.weijian.common.pojo.CommonResult;
import com.weijian.dal.vo.ImageAIVO;
import com.weijian.service.ImageAIService;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.security.PermitAll;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/image")
@Slf4j
@RequiredArgsConstructor
public class ImageController {

    final ImageAIService imageAIService;

    @PostMapping()
    @Operation(summary = "图像生成")
    @PermitAll
    public CommonResult<ImageAIVO> imageChat(
            @RequestParam(value = "message") String message) {
        return imageAIService.imageChat(message);
    }

    @GetMapping("/get")
    @Operation(summary = "图像显示")
    @PermitAll
    public CommonResult<ImageAIVO> imageShow(@RequestParam(value = "id") Long id) {
        return imageAIService.imageShow(id);
    }
}
